#ifndef _OI_PLSCANNERCORE_ETHERNETTASK_HPP_
#define _OI_PLSCANNERCORE_ETHERNETTASK_HPP_

#include "PLScannerCore/OiPLScannerCore.hpp"

namespace Oi
{
    namespace PLScannerCore
    {
        class OI_PLSCANNER_CORE_API EthernetTask : public QThread
        {
            Q_OBJECT

        public:
            EthernetTask( QObject* parent = nullptr);

            ~EthernetTask();

        public:
            void init(bool enable, QString type, QString addr, QString port);
            void exit();

        public:
            bool connected();

        public:
            void run();
            void quit();
            void start();

        public:
            bool write(QByteArray data);
            QByteArray read();

        signals:
            void readReady(const QByteArray data);

        private:
            OI_DISABLE_COPY(EthernetTask);
            OI_DECLARE_IMPL(EthernetTask);
        };
    }

}

#endif